Release 10.1A: OpenEdge Development:
Progress 4GL Reference


COPY-TEMP-TABLE( ) method

Copies a source temp-table object to a target temp-table object. Either of the temp-tables (source or target) may be a member of a ProDataSet object. Progress empties the target temp-table of all records before copying the source temp-table, by default.

Return type: LOGICAL

Applies to: Temp-table object handle

Syntax
targ-tt-handle:COPY-TEMP-TABLE( src-tt-handle [, append-mode 
[, replace-mode [, loose-copy-mode ] ] ] ) 

targ-tt-handle

The handle to the target temp-table object to receive the copy.

src-tt-handle

The handle to the source temp-table object from which to copy.

append-mode

An optional logical expression where TRUE indicates that Progress copy the temp-table object in an append mode.

When TRUE, Progress appends the source temp-table object to the target temp-table object. If there is a unique index on the target temp-table and Progress finds a row with a duplicate key, it does not replace the row. If there is not a unique index on the target temp-table, Progress appends the data row from the source temp-table to the target temp-table, which might result in duplicate rows. If this operation results in duplicate rows, Progress does not generate a run-time error.

Note: In this mode, Progress treats duplicate temp-table rows during the copy operation in the same way it treats duplicate temp-table rows during a fill operation in MERGE mode.

When you are certain a temp-table object does not contain duplicate rows, copying the object in append mode is more efficient than copying it in replace mode.

When FALSE, Progress does not append records in the target temp-table object. The default value is FALSE.

Progress ignores this expression when replace-mode is TRUE.

replace-mode

An optional logical expression where TRUE indicates that Progress copy the temp-table object in a replace mode.

When TRUE, Progress replaces records in the target temp-table object with corresponding records from the source temp-table object. In this case, the source and target temp-tables must be named differently, and the target temp-table must have a unique primary index that Progress can use to find the corresponding record. When the corresponding record is found in the target temp-table, Progress replaces the target record with the source record. When the corresponding record is not found in the target temp-table, Progress creates a new target record using the source record. If the before-image table associated with the target temp-table contains a row for the target record, the row is left in place.

Copying a temp-table object in replace mode is less efficient than copying it in append mode. When you are certain a temp-table object does not contain duplicate rows, copy the object in append mode.

When FALSE, Progress does not replace records in the target temp-table object. The default value is FALSE.

loose-copy-mode

An optional logical expression where TRUE indicates that Progress copy the temp-table object in a loose-copy mode. That is, it relaxes the requirement that the meta-schema for the source and target temp-tables be the same.

When TRUE, Progress copies the source temp-table object to the target temp-table object based on a field mapping between the source and target temp-table buffers. If there is an attached data source with a field mapping, Progress uses that field mapping to copy fields from the source temp-table buffer to its target temp-table buffer. If there are fields in either buffer that do not exist in the other, they are ignored. If there is no field mapping with the attached data source, or there is no attached data source, Progress copies only those fields that appear in both the source and target temp-table meta-schema with the same name.

When FALSE, the meta-schema for the source and target temp-tables must be the same or Progress generates a run-time error. The default value is FALSE.

Notes

See also

FILL-MODE attribute, COPY-DATASET( ) method


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095